class ItemMenu < ActiveRecord::Base
  attr_accessible :ativo, :acao_id, :acao_item_id, :menu_id, :nome, :pai
  
  has_many :children, class_name: "ItemMenu", foreign_key: "pai"
  belongs_to :father, class_name: "ItemMenu", foreign_key: "pai"
  belongs_to :menu
  belongs_to :acao, class_name: "AcaoItemMenu", foreign_key: "acao_id"
end

#TODO Ao selecionar acao_id, preencher o item_id com os itens selecionados...